package net.cloudcodex.shared.dto.msg;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import net.cloudcodex.shared.dto.campaign.character.CharacterHeaderDTO;

/**
 * A scene in a campaign, may concern many characters
 * @author Thomas
 */
public class SceneDTO implements Serializable {
	
	/**
	 * Scene id.
	 */
	private long id;

	/**
	 * Characters associated to the scene.
	 */
	private List<CharacterHeaderDTO> characters;
	
	/**
	 * Messages of the scene.
	 */
	private List<MessageDTO> messages;

	/**
	 * Gives the previous scene by character in scene.
	 * In player view, only the current character is given.
	 */
	private Map<Long, Long> previous = new HashMap<Long, Long>();
	
	/**
	 * Gives the next scene by character in scene.
	 * In player view, only the current character is given.
	 */
	private Map<Long, Long> next = new HashMap<Long, Long>();
	
	/**
	 * The scene timestamp.
	 * This timestamp is used when posting new message to let the server
	 * know if this posting client is up to date (if none, the post fails).
	 */
	private Date timestamp;
	
	/**
	 * @return the id
	 */
	public long getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(long id) {
		this.id = id;
	}

	/**
	 * @return the characters
	 */
	public List<CharacterHeaderDTO> getCharacters() {
		return characters;
	}

	/**
	 * @param characters the characters to set
	 */
	public void setCharacters(List<CharacterHeaderDTO> characters) {
		this.characters = characters;
	}

	/**
	 * @return the messages
	 */
	public List<MessageDTO> getMessages() {
		return messages;
	}

	/**
	 * @param messages the messages to set
	 */
	public void setMessages(List<MessageDTO> messages) {
		this.messages = messages;
	}

	/**
	 * @return the previous
	 */
	public Map<Long, Long> getPrevious() {
		return previous;
	}

	/**
	 * @return the next
	 */
	public Map<Long, Long> getNext() {
		return next;
	}

	/**
	 * @return the timestamp
	 */
	public Date getTimestamp() {
		return timestamp;
	}

	/**
	 * @param timestamp the timestamp to set
	 */
	public void setTimestamp(Date timestamp) {
		this.timestamp = timestamp;
	}
}
